Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to pyflyte init templating #1665

Closed
wants to merge 3 commits into from

Conversation

zeryx
Copy link
Collaborator

@zeryx zeryx commented May 30, 2023

TL;DR

This PR removes the cookiecutter templating system for pyflyte init, and instead uses gitpython, without templating.
This is part of a wider effort to replace our Dockerfile / docker_build.sh systems with the much simpler ImageSpec.

This PR depends on flyteorg/flytekit-python-template#40

This is a breaking change
All templates are now imagespec based, and cookiecutter is no longer used to generate custom readme titles or directory names.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

As discussed as part of the larger Flyte example improvement with newly introduced imagespec.

zeryx added 2 commits May 30, 2023 13:41
Signed-off-by: zeryx <1892175+zeryx@users.noreply.github.com>
Signed-off-by: zeryx <1892175+zeryx@users.noreply.github.com>
@welcome
Copy link

welcome bot commented May 30, 2023

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

@codecov
Copy link

codecov bot commented May 30, 2023

Codecov Report

Merging #1665 (b986379) into master (f671fb6) will decrease coverage by 0.15%.
The diff coverage is 81.25%.

❗ Current head b986379 differs from pull request most recent head 2caed98. Consider uploading reports for the commit 2caed98 to get more accurate results

@@            Coverage Diff             @@
##           master    #1665      +/-   ##
==========================================
- Coverage   71.03%   70.89%   -0.15%     
==========================================
  Files         336      336              
  Lines       30765    30746      -19     
  Branches     5573     2503    -3070     
==========================================
- Hits        21853    21796      -57     
- Misses       8367     8384      +17     
- Partials      545      566      +21     
Impacted Files Coverage Δ
setup.py 0.00% <ø> (ø)
flytekit/clis/sdk_in_container/helpers.py 80.95% <72.72%> (-2.92%) ⬇️
flytekit/clis/sdk_in_container/init.py 100.00% <100.00%> (ø)

... and 23 files with indirect coverage changes

Signed-off-by: zeryx <1892175+zeryx@users.noreply.github.com>
@zeryx zeryx changed the title removal of cookiecutter templating system Updates to pyflyte init templating May 30, 2023
Copy link
Collaborator

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!

We might think about using a brand new repo to hold the examples (instead of flytekit-python-template).

Comment on lines +82 to +85
repo = Repo.clone_from(git_url, "temp_repo")

# Checkout to the branch
repo.git.checkout(branch)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can pass the branch name directly in the call to Repo.clone_from.

Comment on lines +95 to +99
# Copy the files from the source directory to the destination directory
shutil.copytree(src_path, dest_dir)

# Remove the temporary cloned repo
shutil.rmtree("temp_repo")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about we use a TemporaryDirectory to hold the directory? This way we don't need to do this book-keeping and it also allows for this command to be run multiple times.

@@ -68,7 +68,6 @@
"docstring-parser>=0.9.0",
"diskcache>=5.2.1",
"cloudpickle>=2.0.0",
"cookiecutter>=1.7.3",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@kumare3
Copy link
Contributor

kumare3 commented Feb 23, 2024

cc @eapolinario / @neverett do you think you want to check this one in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants